﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CardDataReader : MonoBehaviour
{
    private static CardLibary cardLibary;
    void Awake()
    {
        string CardAttrJson = OperateJson.GetJsonByPath("/Vash/Projects/Yogiho/Config/cardAttr.json");
        if (CardAttrJson.Length > 0)
        {
            cardLibary = JsonUtility.FromJson<CardLibary>(CardAttrJson);
            
        }
        else
        {
            Debug.LogWarning("cardAttr.json is empty");
        }

    }
    public static CardBase GetCardByID(int id){
        return cardLibary.cardData[id];
    }
}
